# Contributor: Guy Godfroy <guy.godfroy@gugod.fr>
# Maintainer: Guy Godfroy <guy.godfroy@gugod.fr>
pkgname=gotify-cli
pkgver=2.3.2
pkgrel=0
pkgdesc="A command line interface for pushing messages to gotify"
url="https://gotify.net"
arch="all"
license="MIT"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/gotify/cli/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/cli-$pkgver"
options="net"

build() {
	export LD_FLAGS="-X main.Version=$pkgver -X main.BuildDate=$(date "+%F-%T")"
	go build -ldflags="${LD_FLAGS}" -o gotify cli.go
}

check() {
	go test ./...
}

package() {
	install -m755 -D "$builddir"/gotify "$pkgdir"/usr/bin/gotify
}

sha512sums="
76b42c7496a5366b2e38f240c77c12b35e48f99e31a06c3fae3c8c18e88409a47df4572875dbb835b0a9fc85f8fa6df73187c4769fd11011ecc5056f45ef87ed  gotify-cli-2.3.2.tar.gz
"
